﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AmuTools;

namespace app.Models
{
    [Model(TableName = "kechengInfo", PrimaryKey = "kechengID", Description = "课程信息")]
    public class CourseInfo
    {
        [Field(FieldName = "kechengID")]
        public string id { get; set; }

        [Field(Description = "学期")]
        public string term { get; set; }
        
        [Field(FieldName = "startDate", DataType = "char(13)", Webable = false, Description = "课程开始时间")]
        public string start_time { get; set; }

        [Field(Storageable = false)]
        public string start_date { get { return start_time.Split(' ')[0]; } }

        [Field(FieldName = "endDate", DataType = "char(13)", Webable = false, Description = "课程结束时间")]
        public string end_time { get; set; }

        [Field(Storageable = false)]
        public string end_date { get { return end_time.Split(' ')[0]; } }
    }
}